home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / doc / glob.n < prev    next >
Text File  |  1993-06-17  |  3KB  |  93 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/glob.n,v 1.3 93/06/17 15:50:54 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS glob tcl 7.0
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. glob \- Return names of files that match patterns
  29. .SH SYNOPSIS
  30. \fBglob \fR?\fIswitches\fR? \fIpattern \fR?\fIpattern ...\fR?
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. This command performs file name ``globbing'' in a fashion similar to
  36. the csh shell.  It returns a list of the files whose names match any
  37. of the \fIpattern\fR arguments.
  38. .LP
  39. If the initial arguments to \fBglob\fR start with \fB\-\fR then
  40. .VS
  41. they are treated as switches.  The following switches are
  42. currently supported:
  43. .TP 15
  44. \fB\-nocomplain\fR
  45. Allows an empty list to be returned without error;  without this
  46. switch an error is returned if the result list would be empty.
  47. .TP 15
  48. \fB\-\|\-\fR
  49. Marks the end of switches.  The argument following this one will
  50. be treated as a \fIpattern\fR even if it starts with a \fB\-.
  51. .VE
  52. .PP
  53. The \fIpattern\fR arguments may contain any of the following
  54. special characters:
  55. .TP 10
  56. \fB?\fR
  57. Matches any single character.
  58. .TP 10
  59. \fB*\fR
  60. Matches any sequence of zero or more characters.
  61. .TP 10
  62. \fB[\fIchars\fB]\fR
  63. Matches any single character in \fIchars\fR.  If \fIchars\fR
  64. contains a sequence of the form \fIa\fB\-\fIb\fR then any
  65. character between \fIa\fR and \fIb\fR (inclusive) will match.
  66. .TP 10
  67. \fB\e\fIx\fR
  68. Matches the character \fIx\fR.
  69. .TP 10
  70. \fB{\fIa\fB,\fIb\fB,\fI...\fR}
  71. Matches any of the strings \fIa\fR, \fIb\fR, etc.
  72. .LP
  73. As with csh, a  ``.'' at the beginning of a file's name or just
  74. after a ``/'' must be matched explicitly or with a {} construct.
  75. In addition, all ``/'' characters must be matched explicitly.
  76. .LP
  77. If the first character in a \fIpattern\fR is ``~'' then it refers
  78. to the home directory for the user whose name follows the ``~''.
  79. If the ``~'' is followed immediately by ``/'' then the value of
  80. the HOME environment variable is used.
  81. .LP
  82. The \fBglob\fR command differs from csh globbing in two ways.
  83. First, it does not sort its result list (use the \fBlsort\fR
  84. command if you want the list sorted).
  85. .VS
  86. Second, \fBglob\fR only returns the names of files that actually
  87. exist;  in csh no check for existence is made unless a pattern
  88. contains a ?, *, or [] construct.
  89. .VE
  90.  
  91. .SH KEYWORDS
  92. exist, file, glob, pattern
  93.